package com.fubang.pathlearning;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.fubang.pathlearning.canvas.CanvasViewActivity;
import com.fubang.pathlearning.circleprogress.CircleProgressActivity;
import com.fubang.pathlearning.path.bessel.SecondOrderBesselActivity;
import com.fubang.pathlearning.path.radar.PathActivity;
import com.fubang.pathlearning.path.rankview.RankChartActivity;
import com.fubang.pathlearning.path.waveview.CircularWaveViewActivity;
import com.fubang.pathlearning.path.waveview.GrowingWaveViewActivity;
import com.fubang.pathlearning.pieview.PieViewActivity;
import com.fubang.pathlearning.popview.PopUpViewActivity;
import com.fubang.pathlearning.tablayout.SlidingTabLayoutActivity;
import com.fubang.pathlearning.titlebar.TitleBarViewActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button pieButton = (Button) findViewById(R.id.bt_1);
        pieButton.setOnClickListener(this);
        Button canvasButton = (Button) findViewById(R.id.bt_2);
        canvasButton.setOnClickListener(this);
        Button pathButton = (Button) findViewById(R.id.bt_3);
        pathButton.setOnClickListener(this);
        Button firstBesselButton = (Button) findViewById(R.id.bt_4);
        firstBesselButton.setOnClickListener(this);
        Button rankButton = (Button) findViewById(R.id.bt_5);
        rankButton.setOnClickListener(this);
        Button CircularWaveButton = (Button) findViewById(R.id.bt_6);
        CircularWaveButton.setOnClickListener(this);
        Button growingWaveButton = (Button) findViewById(R.id.bt_7);
        growingWaveButton.setOnClickListener(this);
        Button titleBarButton = (Button) findViewById(R.id.bt_8);
        titleBarButton.setOnClickListener(this);
        Button percentCircleButton = (Button) findViewById(R.id.bt_9);
        percentCircleButton.setOnClickListener(this);
        Button tabButton = (Button) findViewById(R.id.bt_10);
        tabButton.setOnClickListener(this);
        Button popButton = (Button) findViewById(R.id.bt_11);
        popButton.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_1:
                startActivity(new Intent(this, PieViewActivity.class));
                break;
            case R.id.bt_2:
                startActivity(new Intent(this, CanvasViewActivity.class));
                break;
            case R.id.bt_3:
                startActivity(new Intent(this, PathActivity.class));
                break;
            case R.id.bt_4:
                startActivity(new Intent(this, SecondOrderBesselActivity.class));
                break;
            case R.id.bt_5:
                startActivity(new Intent(this, RankChartActivity.class));
                break;
            case R.id.bt_6:
                startActivity(new Intent(this, CircularWaveViewActivity.class));
                break;
            case R.id.bt_7:
                startActivity(new Intent(this, GrowingWaveViewActivity.class));
                break;
            case R.id.bt_8:
                startActivity(new Intent(this, TitleBarViewActivity.class));
                break;
            case R.id.bt_9:
                startActivity(new Intent(this, CircleProgressActivity.class));
                break;
            case R.id.bt_10:
                startActivity(new Intent(this, SlidingTabLayoutActivity.class));
                break;
            case R.id.bt_11:
                startActivity(new Intent(this, PopUpViewActivity.class));
                break;
            default:
                break;
        }
    }
}
